--
-- Author: shunguo.chen
-- Date: 2017-12-27 15:09:27
--
-- PvpRewardView pvp赛季奖励

local fileName = string.getModeName(...)
local ClassRef = class(fileName, app.mvc.ViewBase)

ClassRef.VIEW_ROOT_RES = Res.PvpRewardScene

local SEASON_STR = L("ChampionshipSeasonLevel")

function ClassRef:init()
	self._ui.Button_queding:addClickEventListener(function()
			executeFunc(self._onOperate, "openBox")
			executeFunc(self._onCloseView, self)
		end)

	local icon = self._ui["Panel/icon_1"]
    display.uiAddClick(icon, function()
        executeFunc(self._onOperate, "openBox")
        executeFunc(self._onCloseView, self)
    end)

    icon:getChildByName("icon"):loadTexture(Res.BoxIconAry[Enums.BoxType.dungeon])

    self._ui.tlt:setString(L("champion_score3"))

    self._ui.tips_up:setVisible(false)
    self._ui.tips_down:setVisible(false)
end

function ClassRef:show()
	self:setVisible(true)
	self:openAction()
	self:performWithDelay(function()
		self:playAction("animation", true)
	end, 1)
end

-- seasonLv 赛季等级
function ClassRef:refresh(seasonLv)
    self._ui.tips:setString(string.format(SEASON_STR, seasonLv))

    -- 设置居中
    display.setNodesMiddle(self._ui.Panel, self._ui.tips_img, self._ui.tips)
end


return ClassRef